
********************************************************************************	 
cd $pathdata_processed
use sample_tirage, clear

//predicted exam grade in each topic
gen skr_hat = real_stp 

cd $pathdata_processed_cc
save tirage_temp, replace
********************************************************************************

levelsof year_vg3, c
foreach year in `r(levels)' {
	cd $pathdata_processed_cc
	use if year_vg3 == `year' using tirage_temp, clear

	drop if nb_exam == 0 
	
	sort nb_exam nb_kurs npid fagkode
	egen group = group(nb_kurs nb_exam)

	save tirage_temp`year', replace
	}
